package com.wx.oauth.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;


/**
 * @author Chenhaowen
 * @since 2019/8/5 17:57.
 */
@Controller
@RequestMapping("/user/")
public class UserController extends BaseController {

    @RequestMapping("test")
    @ResponseBody
    public String test(String openid){
        System.out.println(openid);
        return "hello";
    }


    @RequestMapping("redirect")
    public String redirect(RedirectAttributes attributes){
        attributes.addAttribute("openid","123456ll");
        return "redirect:/user/test";
    }

}
